﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

using XGameFrame.Collision;

namespace XGameFrame.Graphic
{
    public abstract class StaticSpriteBase:CoreGraphicElement
    {
        #region Constructor
        public StaticSpriteBase(Texture2D pTexture,Vector2 pPosition)
            :base(pTexture,pPosition)
        {

            Size = new Vector2((float)Texture.Width, (float)Texture.Height);

            Bounds = new Rectangle((int)Position.X,
            (int)Position.Y,
            (int)Texture.Width,
            (int)Texture.Height);

            SourceRectangle = new Rectangle(
            0,
            0,
            (int)Texture.Width,
            (int)Texture.Height);

            DestRectangle = new Rectangle((int)Position.X,
                (int)Position.Y,
                (int)Texture.Width,
                (int)Texture.Height);
        }
        #endregion

        #region abstract Methods
        public virtual void Update(GameTime pGameTime)
        {

        }

        public abstract void Draw(SpriteBatch pSpriteBatch);
        /// <summary>
        /// Do logic if the element is Hover
        /// </summary>
        /// <param name="pPlayerIndex">normally the player how has hoverd the element</param>
        public abstract void OnHover(PlayerIndex pPlayerIndex);

        public abstract void HandleInput(PlayerIndex pPlayerIndex);

        #endregion


    }
}
